<?php
/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * @Date: 2021-07-27 14:55:18
 * @LastEditors: Sam
 * @LastEditTime: 2022-02-25 14:51:28
 */

namespace app\admin\model;
use think\Model;


/**
 * 提现记录
 * Class User
 * @package app\admin\model\user
 */
class Withdrawal extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'withdrawal';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function user(){
        return $this->belongsTo(User::class,'uid')->bind(['nickname','avatar','mobile']);
    }


    public function disuser(){
        return $this->belongsTo(Distributor::class,'did')->bind(['name','mobile']);
    }

    public function getStatusTextAttr($value,$data){
        $status  = [0=>"待审核",1=>'审核通过',2=>'审核拒绝'];
        return $status[$data['status']];
    }


}